<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        ul{
            display: flex;
        }
        li{
            list-style: none;
            margin-left: 10px;
            cursor: pointer;
        }
        .seclectStyle{
            color: rgb(64, 64, 238);
            border-bottom: 1px solid rgb(64, 64, 238);
        }
    </style>
</head>
<body>
    <!-- 课件练习-tab切换 -->
    <div id="app">
        <ul>
            <li v-for="item in list" :class="item.id === selectId ? 'seclectStyle' : '' " @click="changeSelect(item.id)">
                {{ item.name }}
            </li>
        </ul>
    </div>
    <script src="../js/vue.js"></script>
    <script>
        const app = new Vue({
            el:'#app',
            data(){
                return {
                    list:[
                        {
                            id:1,
                            name:'用户管理'
                        },
                        {
                            id:2,
                            name:'配置管理'
                        },
                        {
                            id:3,
                            name:'角色管理'
                        }
                    ],
                    selectId:1
                }
            },
            methods:{
                changeSelect(id){
                    this.selectId = id
                }
            }
        })
    </script>
</body>
</html>